import 'package:flutter_test/flutter_test.dart';
import 'package:unique_ios_device_id/unique_ios_device_id.dart';
import 'package:unique_ios_device_id/unique_ios_device_id_platform_interface.dart';
import 'package:unique_ios_device_id/unique_ios_device_id_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockUniqueIosDeviceIdPlatform 
    with MockPlatformInterfaceMixin
    implements UniqueIosDeviceIdPlatform {

  @override
  Future<String?> getPlatformVersion() => Future.value('42');

  @override
  Future<String?> getDeviceId(String key) => Future.value('12345678-1234-1234-1234567890AB');
}

void main() {
  final UniqueIosDeviceIdPlatform initialPlatform = UniqueIosDeviceIdPlatform.instance;

  test('$MethodChannelUniqueIosDeviceId is the default instance', () {
    expect(initialPlatform, isInstanceOf<MethodChannelUniqueIosDeviceId>());
  });

  test('getPlatformVersion', () async {
    UniqueIosDeviceId uniqueIosDeviceIdPlugin = UniqueIosDeviceId();
    MockUniqueIosDeviceIdPlatform fakePlatform = MockUniqueIosDeviceIdPlatform();
    UniqueIosDeviceIdPlatform.instance = fakePlatform;
  
    expect(await uniqueIosDeviceIdPlugin.getPlatformVersion(), '42');
  });
}
